package com.mi.queryhivedemo.job;

import com.mi.queryhivedemo.dao.TestDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Auther：yong.li
 * Data:2020/7/1 15:26
 * Description:
 */
@Component
@EnableScheduling
public class TestJob {
    @Autowired
    TestDao testDao;

    @Value("${sqltest}")
    String Sql;

    @Scheduled(fixedRate = 100000 * 10000)
    public void runsecend(){
        System.out.println(testDao.test(Sql));
        System.out.println("********记得kill掉任务******这里使用的是定时任务，当然也直接可调用方法");
    }
}
